<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
	<style>img{ height: 100px; float: left; }</style>
	<script src="http://code.jquery.com/jquery-latest.js"></script>
	<script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
	<script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/json/json-min.js"></script>
	<script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/connection/connection-min.js"></script>
  
</head>
<body>
  <div id="images">

</div>
<script>
/*
var obj = jQuery.parseJSON('{"id":2,"title":"Please Follow the rules","content":"Hi, everyone!! You need to follow the rule state on the rule page, otherwise you will get bang!!","timeCreated":1329897544,"timeModified":1329897544,"adminId":1,"admin":null}');
alert( obj.content);
*/

	var method = "GET";
	var url = '<c:url value='/api/announcement'/>';
		
	YAHOO.util.Connect.asyncRequest(method, url, {
		success: function(o) {
			var s = o.responseText;
			var r = YAHOO.lang.JSON.parse(s);
			alert(r[0].id);
		},
		failure: function(o) {
			var error = o.status + " " + o.statusText;
			alert(error);
		}
	});

</script>

</body>
</html>